home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / fpc / compiler / opts386.pas < prev    next >
Pascal/Delphi Source File  |  1998-09-24  |  7KB  |  213 lines

  1. {
  2.     $Id: opts386.pas,v 1.1.1.1 1998/03/25 11:18:14 root Exp $
  3.     Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
  4.  
  5.     interprets the commandline options which are i386 specific
  6.  
  7.     This program is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program; if not, write to the Free Software
  19.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21.  ****************************************************************************
  22. }
  23. unit opts386;
  24. interface
  25.  
  26. uses
  27.   options;
  28.  
  29. type
  30.   poption386=^toption386;
  31.   toption386=object(toption)
  32.     procedure interpret_proc_specific_options(const opt:string);virtual;
  33.   end;
  34.  
  35. implementation
  36.  
  37. uses
  38.   globals;
  39.  
  40. procedure toption386.interpret_proc_specific_options(const opt:string);
  41. var
  42.   j : longint;
  43. begin
  44.   case opt[2] of
  45.    'A' : begin
  46.            if copy(opt,3,length(opt)-2)='o' then
  47.             begin
  48.               output_format:=of_o;
  49.               assem_need_external_list:=false;
  50.             end
  51.            else
  52.             if copy(opt,3,length(opt)-2)='masm' then
  53.              begin
  54.                output_format:=of_masm;
  55.                assem_need_external_list:=true;
  56.              end
  57.            else
  58.             if copy(opt,3,length(opt)-2)='att' then
  59.              begin
  60.                output_format:=of_att;
  61.                assem_need_external_list:=false;
  62.              end
  63.            else
  64.             if copy(opt,3,length(opt)-2)='win32' then
  65.              begin
  66.                output_format:=of_win32;
  67.                assem_need_external_list:=false;
  68.              end
  69.            else
  70.             if copy(opt,3,length(opt)-2)='obj' then
  71.              begin
  72.                output_format:=of_obj;
  73.                assem_need_external_list:=true;
  74.              end
  75.            else
  76.             if copy(opt,3,length(opt)-2)='nasm' then
  77.              begin
  78.                output_format:=of_nasm;
  79.                assem_need_external_list:=true;
  80.              end
  81.            else
  82.             IllegalPara(opt);
  83.          end;
  84.    'O' : begin
  85.            for j:=3 to length(opt) do
  86.            case opt[j] of
  87.             '-' : initswitches:=initswitches-[cs_optimize,cs_maxoptimieren,cs_littlesize];
  88.             'a' : initswitches:=initswitches+[cs_optimize];
  89.             'g' : initswitches:=initswitches+[cs_littlesize];
  90.             'G' : initswitches:=initswitches-[cs_littlesize];
  91.             'x' : initswitches:=initswitches+[cs_optimize,cs_maxoptimieren];
  92.             'z' : initswitches:=initswitches+[cs_optimize,cs_uncertainopts];
  93.             '2' : opt_processors:=pentium2;
  94.             '3' : opt_processors:=globals.i386;
  95.             '4' : opt_processors:=i486;
  96.             '5' : opt_processors:=pentium;
  97.             '6' : opt_processors:=pentiumpro;
  98.             else IllegalPara(opt);
  99.             end;
  100.           end;
  101.     'R' : begin
  102.             if copy(opt,3,length(opt)-2)='att' then
  103.              aktasmmode:=I386_ATT
  104.             else
  105.              if copy(opt,3,length(opt)-2)='intel' then
  106.               aktasmmode:=I386_INTEL
  107.             else
  108.              if copy(opt,3,length(opt)-2)='direct' then
  109.               aktasmmode:=I386_DIRECT
  110.             else
  111.              IllegalPara(opt);
  112.           end;
  113.   else IllegalPara(opt);
  114.   end;
  115. end;
  116.  
  117. end.
  118. {
  119.   $Log: opts386.pas,v $
  120.   Revision 1.1.1.1  1998/03/25 11:18:14  root
  121.   * Restored version
  122.  
  123.   Revision 1.17  1998/03/10 01:17:21  peter
  124.     * all files have the same header
  125.     * messages are fully implemented, EXTDEBUG uses Comment()
  126.     + AG... files for the Assembler generation
  127.  
  128.   Revision 1.16  1998/03/06 01:09:00  peter
  129.     * removed the conflicts that had occured
  130.  
  131.   Revision 1.15  1998/03/06 00:52:30  peter
  132.     * replaced all old messages from errore.msg, only ExtDebug and some
  133.       Comment() calls are left
  134.     * fixed options.pas
  135.  
  136.   Revision 1.14  1998/03/05 22:41:52  florian
  137.     + missing constructor to options object added
  138.  
  139.   Revision 1.13  1998/03/05 02:44:14  peter
  140.     * options cleanup and use of .msg file
  141.  
  142.   Revision 1.12  1998/03/04 17:33:47  michael
  143.   + Changed ifdef FPK to ifdef FPC
  144.  
  145.   Revision 1.11  1998/03/02 21:21:39  jonas
  146.     + added support for uncertain optimizations
  147.  
  148.   Revision 1.10  1998/03/02 01:48:47  peter
  149.     * renamed target_DOS to target_GO32V1
  150.     + new verbose system, merged old errors and verbose units into one new
  151.       verbose.pas, so errors.pas is obsolete
  152.  
  153.   Revision 1.9  1998/02/22 23:03:20  peter
  154.     * renamed msource->mainsource and name->unitname
  155.     * optimized filename handling, filename is not seperate anymore with
  156.       path+name+ext, this saves stackspace and a lot of fsplit()'s
  157.     * recompiling of some units in libraries fixed
  158.     * shared libraries are working again
  159.     + $LINKLIB <lib> to support automatic linking to libraries
  160.     + libraries are saved/read from the ppufile, also allows more libraries
  161.       per ppufile
  162.  
  163.   Revision 1.8  1998/02/13 10:35:12  daniel
  164.   * Made Motorola version compilable.
  165.   * Fixed optimizer
  166.  
  167.   Revision 1.7  1998/02/12 11:50:15  daniel
  168.   Yes! Finally! After three retries, my patch!
  169.  
  170.   Changes:
  171.  
  172.   Complete rewrite of psub.pas.
  173.   Added support for DLL's.
  174.   Compiler requires less memory.
  175.   Platform units for each platform.
  176.  
  177.   Revision 1.6  1998/02/08 23:56:55  peter
  178.     + -O- to turn off optimizes
  179.  
  180.   Revision 1.5  1998/01/23 17:12:14  pierre
  181.     * added some improvements for as and ld :
  182.       - doserror and dosexitcode treated separately
  183.       - PATH searched if doserror=2
  184.     + start of long and ansi string (far from complete)
  185.       in conditionnal UseLongString and UseAnsiString
  186.     * options.pas cleaned (some variables shifted to globals)gl
  187.  
  188.   Revision 1.4  1998/01/07 00:16:54  michael
  189.   Restored released version (plus fixes) as current
  190.  
  191.   Revision 1.2  1997/12/15 09:11:29  florian
  192.     + again opts386.pas commited (there was an error)
  193.  
  194.   Revision 1.1.1.1  1997/11/27 08:32:57  michael
  195.   FPC Compiler CVS start
  196.  
  197.  
  198.   Pre-CVS log:
  199.  
  200.   CEC   Carl-Eric Codere
  201.   FK    Florian Klaempfl
  202.   PM    Pierre Muller
  203.   +     feature added
  204.   -     removed
  205.   *     bug fixed or changed
  206.  
  207.   History:
  208.        8th october 1997:
  209.          * started from options.pas (FK)
  210.        23th november 1997:
  211.          + added -R option for different assembler reading style (PM)
  212. }
  213.